Automated AWS Resource Compliance Monitor

A scalable, serverless solution leveraging AWS services to enforce security and cost compliance across cloud resources

Timeline April 2025
Role Cloud Engineer
Status Completed
AWS Lambda AWS DynamoDB AWS EventBridge AWS SNS AWS S3 AWS CloudWatch

Project Overview

Designed and implemented a serverless compliance monitoring system that scans AWS resources, detects issues, and remediates them automatically while providing real-time reporting to stakeholders. This architecture addresses challenges in maintaining cloud security, optimizing costs, and reducing human error, all while offering scalability and automation.

EventBridge Lambda compliance_scanner.py SNS DynamoDB Lambda reporting.py S3 Lambda remediation.py CloudWatch Schedule Trigger Log Metrics Alert Store Findings Report Message Store Reports DB Stream Trigger

Workflow

Event Triggering

EventBridge schedules compliance scans daily or dynamically based on resource changes.

Compliance Scanning

  • Lambda function (compliance_scanner.py) identifies violations in S3 buckets, security groups, and EBS volumes
  • Findings are stored in DynamoDB and logged in CloudWatch for metrics aggregation
  • Critical findings are sent to stakeholders via SNS notifications

Violation Handling

  • DynamoDB Streams trigger the Remediation Lambda function to auto-resolve common compliance issues
  • Updates violation status in DynamoDB to REMEDIATED

Report Generation

Lambda function generates daily compliance summaries, uploads reports to S3, and sends report links via SNS emails

Metrics & Dashboards

CloudWatch Insights queries and dashboards visualize compliance trends, top violations, and remediation actions

Key Features

Technical Implementation

The solution architecture implements a fully serverless approach with several key components:

1. Compliance Scanner

  • Script: compliance_scanner.py
  • Functionality: Scans AWS resources for compliance violations
  • Logs findings in DynamoDB and CloudWatch Logs
  • Alerts stakeholders of critical issues using SNS

2. Remediation

  • Script: remediation.py
  • Functionality: Triggered by DynamoDB Streams for real-time updates
  • Auto-remediates issues such as missing S3 bucket encryption
  • Updates violation status in DynamoDB to REMEDIATED

3. Reporting

  • Script: reporting.py
  • Functionality: Queries DynamoDB for compliance history
  • Generates JSON reports stored in S3
  • Sends email notifications to stakeholders with a link to the report

4. Metrics and Dashboards

  • Tools: CloudWatch Insights, Custom Dashboards
  • Functionality: Aggregates compliance scores, issue trends, and remediation actions into visual dashboards

Results & Impact

Project Gallery

Future Enhancements